package com.chat.module.act;

import com.chat.comment.core.ResponseResult;
import com.chat.module.user.service.impl.UserLinkInfoServiceImpl;
import com.chat.module.act.vo.ChatActVo;
import com.comment.pojo.domain.chat.UserLinkInfo;
import com.comment.util.JwtUtils;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

import java.util.List;


@RestController
@RequestMapping("/userLinkInfoAct")
public class UserLinkInfoAction {
    @Resource
    private UserLinkInfoServiceImpl userLinkInfoService;

    @ApiOperation("查询用户的在线信息")
    @PostMapping("/select")
    public ResponseResult<List<UserLinkInfo>> select(
            @RequestHeader String token,
            @RequestBody ChatActVo.select vo
    ) {
        return ResponseResult.success(userLinkInfoService.select(JwtUtils.getUserId(token),vo.getUserIds()));
    }
}
